import java.util.Arrays;

public class ByteIntegerUtil {
	
	

	public static byte[] intToDWord(int i) {
		byte[] dword = new byte[4];
		dword[0] = (byte) ((i >> 24) & 0xFF);
		dword[1] = (byte) ((i >> 16) & 0xFF);
		dword[2] = (byte) ((i >> 8) & 0xFF);
		dword[3] = (byte) (i & 0xFF);
		return dword;
	}
	
	public static int dWordToInt( byte[] dword ) {
		int integer = 0;
		integer |= (dword[0] & 0xFF) << 24;
		integer |= (dword[1] & 0xFF) << 16;
		integer |= (dword[2] & 0xFF) << 8;
		integer |= dword[3] & 0xFF;
		return integer;
	}
	


	
	

	
	public static void main(String[] args) {

		System.out.println( Arrays.toString( intToDWord(65535) ));
		System.out.println( dWordToInt( intToDWord(65535)) );
	}

}
